package com.atguigu.edu.controller;

import com.atguigu.commonUtils.R;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/edu/user")
//@CrossOrigin //解决跨域  访问协议，IP地址，端口号 有任何一个不一样，都会产生跨域问题
public class LoginController {

    //login
    @PostMapping("/login")
    public R login(){
        return R.ok().data("token","admin");
    }

    //info
    @GetMapping("/info")
    public R info(){
        return R.ok().data("roles","[admin]").data("name","admin")
                .data("avatar","https://oss.aliyuncs.com/aliyun_id_photo_bucket/default_handsome.jpg");
    }

}
